using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Fungus;
using UnityEngine.UI;



public class 任务系统 : MonoBehaviour
{
    public GameObject 石头1;
    public GameObject 石头2;
    public GameObject 石头3;
    bool IfTalkright3;
    bool IfTalkright2;
    bool IfTalkright1;
    public Text 任务UI;
    public bool 去迷宫;

    private void Awake()
    {
        
    }
    // Start is called before the first frame update
    void Start()
    {
        
        
    }

    // Update is called once per frame
    void Update()
    {
        显示任务();
        
        显示石头();
       
        
    }
    void 显示石头()
    {
        Flowchart flowchart = GameObject.Find("Flowchart").GetComponent<Flowchart>();
        IfTalkright1 = flowchart.GetBooleanVariable("IfTalkright1");
        IfTalkright2 = flowchart.GetBooleanVariable("IfTalkright2");
        IfTalkright3 = flowchart.GetBooleanVariable("IfTalkright3");
        if (IfTalkright3 == true)
        {
            石头3.SetActive(true);
        }
        if (IfTalkright1 == true)
        {
            石头1.SetActive(true);
        }
        if (IfTalkright2 == true)
        {
            石头2.SetActive(true);
        }
        
    }
    void 显示任务()
    {
        Flowchart flowchart = GameObject.Find("Flowchart").GetComponent<Flowchart>();
        IfTalkright3 = flowchart.GetBooleanVariable("IfTalkright3");
        if (IfTalkright3 == true)
        {
            任务UI.text = "前往山顶";

            
        }
    }
    void 去迷宫函数()
    {
        Flowchart flowchart2 = GameObject.Find("Flowchart2").GetComponent<Flowchart>();
        去迷宫 = flowchart2.GetBooleanVariable("去迷宫");
        if (去迷宫 == true)
        {
            任务UI.text = "找到前往现实的路";
        }

    }
    

}
